import pygtk
import gtk
from gtk import glade
import cairo

class PaneTest(object):
    """
    Testing the Glade GUI builder and PyGTK
    """
    def __init__(self):
        # load the glade file
        self.wTree = glade.XML('pane-test.glade')
        self.window = self.wTree.get_widget("window1")
        if (self.window):
            self.window.connect("destroy", gtk.main_quit)

        prev = self.wTree.get_widget("drawingarea1")
        cr = prev.window.cairo_create()
        #cr = prev.window.create_cairo_context()
        cr.clip()
        # Fill the background with white
        cr.set_source_rgb(0.9, 0.9, 0.9)
        cr.rectangle(0, 0, 400, 50)
        cr.fill()
        #cr.update_layout()
        #import pdb;pdb.set_trace()

if __name__ == '__main__':
    bt = PaneTest()
    gtk.main()
